Skip to content

Conversation

@mgiannopoulos24
Copy link
Contributor

Description:

This PR adds the ability to reorder snippets via drag-and-drop on the "All Snippets" administration page. This improves the UX for managing snippet execution order, replacing the need to manually edit priority numbers.

Related issue:

Issue #314

Changes

  • JS: Created src/js/services/manage/ordering.ts to initialize jQuery UI Sortable on the snippets table. It calculates the new priority based on the row index and sends an AJAX request to update the database immediately upon drop.
  • CSS: Added styles to src/css/manage.scss to change the cursor to move on hover and style the sortable placeholder (dashed border) for better visual feedback.
  • Entry Point: Updated src/js/manage.ts to initialize the ordering service.

@imantsk imantsk requested a review from sheabunge December 15, 2025 19:14
@louiswol94 louiswol94 added the run-tests Trigger automated tests label Dec 15, 2025
@louiswol94
Copy link
Contributor

snippet-row-active-actual snippet-row-active-diff snippet-row-active-expected Just noting a styling change that seems to be caused by this PR.

@mgiannopoulos24
Copy link
Contributor Author

Okay I'll have a look.

@mgiannopoulos24
Copy link
Contributor Author

mgiannopoulos24 commented Dec 15, 2025

Are the tests bugged? Even on core branch, 7 of them pass.

I can't really replicate the bug you attached, or pass all the tests.

The styling bug happened while you ran the tests, or you tested it manually?

@louiswol94
Copy link
Contributor

@mgiannopoulos24 Sorry it seems this was not related to your changes!

@mgiannopoulos24
Copy link
Contributor Author

@louiswol94 Have you developed new tests because these fail? I've seen on some other PR that you pass them all.

@louiswol94 louiswol94 merged commit 2c8c045 into codesnippetspro:core Dec 18, 2025
@louiswol94
Copy link
Contributor

@mgiannopoulos24 Merged. Thank you so much for the contribution! 🚀

@mgiannopoulos24 mgiannopoulos24 deleted the feat/drag-drop-snippets branch December 18, 2025 13:55
imantsk added a commit that referenced this pull request Dec 18, 2025
…nippets"

This reverts commit 2c8c045, reversing
changes made to f269721.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants